﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using Factonomy.AzureUtility.Core;

namespace Factonomy.AzureUtility.Dialogs
{
    /// <summary>
    /// Interaction logic for StringPrompt.xaml
    /// </summary>
    public partial class StringPrompt : Window
    {
        public event StringPromptDelegate ReturnValue;

        protected virtual void OnReturnValue(string value)
        {
            if (ReturnValue != null)
                ReturnValue(value, this);
        }

        public string Value
        {
            get { return this.uiTextValue.Text; }
        }

        public StringPrompt()
        {
            InitializeComponent();
        }

        public void Ok(object sender, RoutedEventArgs e)
        {
            this.OnReturnValue(this.uiTextValue.Text);
        }

        public void Cancel(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
